﻿#include<iostream>
#include<list>


void printList(const std::list<int>& L)
{
	for (std::list<int>::const_iterator it = L.begin(); it != L.end(); ++it)
	{
		std::cout << *it << " ";
	}
	std::cout << '\n';
}

void test01()
{
	std::list<int>L1;
	L1.push_back(10);
	L1.push_back(20);
	L1.push_back(30);
	L1.push_back(40);
	printList(L1);

	if (L1.empty())
	{
		std::cout << "L1为空" << '\n';
	}
	else
	{
		std::cout << "L1不为空" << '\n';
		std::cout << "大小为：" << L1.size() << '\n';
	}

	L1.resize(10);
	printList(L1);

	L1.resize(16, 9);
	printList(L1);

	L1.resize(2);
	printList(L1);
}

int main()
{
	test01();




	return 0;
}